#!/bin/sh
echo 升级时间：$(date +%Y-%m-%d-%l:%M:%S) >> $1/logs/upgrade.log

echo 旧版本将备份为$2 >> $1/logs/upgrade.log
echo 新版本$3将部署到tomcat >> $1/logs/upgrade.log

echo 正在关闭tomcat服务 >> $1/logs/upgrade.log
$1/bin/shutdown.sh

echo 备份旧版本 >> $1/logs/upgrade.log
mv $1/webapps $2
rm -rf $1/temp

echo 加载新版本 >> $1/logs/upgrade.log
mv $3 $1/webapps

echo 重启tomcat >> $1/logs/upgrade.log
$1/bin/startup.sh

echo 部署成功 >> $1/logs/upgrade.log